import request from '@/utils/request'

/**
 * 获取用户列表
 */
export const getUserInfoListApi = data => {
  return request({
    method: 'get',
    url: '/auth/user',
    params: data
  })
}

/**
 * 删除
 */
export const delUserApi = id => {
  return request({
    method: 'delete',
    url: `/auth/user/${id}`
  })
}

/**
 * 添加角色
 */
export const addUserApi = data => {
  return request({
    method: 'post',
    url: '/auth/user',
    data
  })
}

/**
 * 获取用户详情信息
 */
export const getUserDetailApi = id => {
  return request({
    method: 'get',
    url: `auth/user/${id}`
  })
}

/**
 * 修改用户详情
 */
export const editUserApi = data => {
  return request({
    method: 'put',
    url: `/auth/user/${data.id}`,
    data
  })
}
